package com.bicon.life.core.base.repository.ibatis;

import com.bicon.life.core.base.repository.IBaseRepository;

/**
 * Created by L on 2017/5/23.
 */
public abstract class IBatisBaseDao<T> {

    protected abstract IBaseRepository<T> getRepository();

    public int deleteByPrimaryKey(String id){
        return getRepository().deleteByPrimaryKey(id);
    }

    public int insert(T record){
        return getRepository().insert(record);
    }

    public int insertSelective(T record){
        return getRepository().insertSelective(record);
    }

    public T selectByPrimaryKey(String id){
        return getRepository().selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(T record){
        return getRepository().updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(T record){
        return getRepository().updateByPrimaryKey(record);
    }

}
